Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

surface any errors encountered during schema validation #672

Merged

Conversation

sudermanjr
Copy link
Member

Checklist

  • I have signed the CLA
  • I have updated/added any relevant documentation

Description

What's the goal of this PR?

Currently, if the marshalling the file to JSON fails, reckoner returns a non-descriptive error.

failed to validate jsonSchema in course file: course.yml
Course file has schema validation errors - error opening course file course.yml: Course file has schema validation errors

This PR changes that error to:

Course file has schema validation errors - error opening course file course.yml: unable to parse secrets: yaml: line 3: mapping values are not allowed in this context

What changes did you make?

Instead of passing the generic SchemaValidationError, we pass back the actual error. The SchemaValidationError is only used if there are actual schema validation errors.

What alternative solution should we consider, if any?

n/a

@sonarcloud
Copy link

sonarcloud bot commented Mar 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sudermanjr sudermanjr enabled auto-merge (squash) March 1, 2023 19:42
@sudermanjr sudermanjr merged commit 1b82cb8 into master Mar 2, 2023
@sudermanjr sudermanjr deleted the sudermanjr/surface-json-marshal-errors-in-schema-validation branch March 2, 2023 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants